In this folder are several example programs that demonstrate various aspects of SpriteWorld. Probably one of the best ways to learn how to use SpriteWorld is to open one of the demos and start playing with it, changing things here and there until you become familiar with how SpriteWorld operates.
Some of the demos, such as the Scrolling demos, are controlled with either the numeric keypad or the arrow keys. Simply use these keys to scroll around the screen.
Most of the demos are limited to a certain speed to keep them from going too fast on faster Macs. If you want to see how fast a demo can really go, look for the #defined value kMaxFPS at the beginning of the demo's source code and change it to 0 to let the animation run as fast as possible.
Want to See More?
More demos are included in a separate package called "SpriteWorld 2.1 Extra Demos". This package includes the old Large Background scrolling demo, a new Circular Scrolling Demo, some demos of Brian's Utilities that show lighting, translucency, scaling, and other effects, and more. This package should be available from the same place you got SpriteWorld, and is also available at the SpriteWorld Home Page.
Think C Users
The Think C projects are no longer supported, since Think C crashes on my PowerMac, and I no longer have a 68k computer in the house to maintain the projects. Most of them should run with no problems, although you may have to change a thing or two to get some of them to run. For instance, to get the Think C project for Shark Attack to compile, you may need to remove Sound.c and add SWSound.c.
If You Run Into Compile Errors
In order to work with the latest Universal Headers (included with CW Pro), the demos now include Gestalt.h, previously named GestaltEqu.h. In addition, an unsigned long is passed to the Delay() function, whereas a long was passed previously. If you get errors related to these changes when you try to compile a SpriteWorld project, you can either upgrade to the latest version of the Universal Headers, or modify the SpriteWorld source code so it is compatible with your version of the Universal Headers. To fix any Delay() compile errors, simply change the variable that is passed to the function from an unsigned long to a long. To fix the Gestalt problem, change SpriteWorld.c, SpriteWorldUtils.c, and Scrolling.c to use the old method for including the Gestalt header:
#ifndef __GESTALTEQU__
#include <GestaltEqu.h>
#endif
The headers that come with CodeWarrior Pro should already be compatible with SpriteWorld. If you have an earlier version of CodeWarrior, or some other development environment, you can get the latest headers from:
http://devworld.apple.com/sdk/index.html
If that link doesn't work, just go to devworld.apple.com and enter "Universal Interfaces" in the Find field at the bottom of the page. If you only use C or C++, you can download the version of the headers that contains no Pascal or Assembly headers.
See the SpriteWorld FAQ for information on updating Think C or CodeWarrior to the latest version of the Universal Interfaces. Note: if you update Think C to the latest version of the headers (3.0 or later), you will have to make several changes to your "Mac #includes.c" file in order to get everything to work when you precompile MacHeaders. If you need a copy of the updated version of Mac #includes.c, just ask Vern, and he'll send it to you.
If You Use CodeWarrior Pro
If you use CodeWarrior Pro, the name of one of the PPC libraries has changed. Remove MWCRuntime.Lib from your project and add MSL RuntimePPC.Lib. You may also need to add an access path to the Metrowerks Standard Library folder.
If A Project Won't Open
The CodeWarrior projects are in CW 10 format. This was done to make them compatible with CW Pro. (CW 9 and earlier projects won't open in CW Pro.) If you have CW 9 or earlier, you'll get an error message when you try to open one of the provided project files. You'll have to make your own projects, adding the following:
A) All the files in the SpriteWorld Files->Sources folder.
B) All the source code in the demo's folder, as well as the project's resource file.
C) Most demos require certain utilities from the SpriteWorld FIles->Utils folder, such as SWApplication.c, SWFPSReport.c, and SWGameUtils.c.
D) You'll also need to add the Mac libraries necessary for any Macintosh application. For CodeWarrior 68k apps, add the MacOS.lib, and for PPC projects, add the InterfaceLib and the MWCRuntime.Lib.
There are a couple of exceptions, such as the Tiling Demo and SpriteTest, which need SWDitherDown.c. Also, the Split-Screen Scrolling demo requires the Multi-Screen Scrolling.c file, which is found in the SpriteWorld Files->Utils folder. Most of the demos need a memory allocation of about 2000k to run in 256 colors at 640x480.
You'll also need to add an access path to the SpriteWorld Files folder. Go to the project's preferences, select "Access Paths", and click anywhere in the "System:" panel. Then push the "Add" button and locate the SpriteWorld Files folder, located in your CodeWarrior folder. (You should have moved it there when installing SpriteWorld.) Double-click on the SpriteWorld Files folder, then hit the "Select SpriteWorld Files" button at the bottom of the dialog.